package cn.zptc.service;

import cn.zptc.entity.Favorite;
import cn.zptc.entity.FavoriteCategory;

import java.sql.SQLException;
import java.util.List;

public interface FavoriteService {
    List<FavoriteCategory> getMyFavoriteCategorys(int userId) throws SQLException;

    int addFavorite(Favorite favorite) throws SQLException;

    /**
     * 获取我的收藏
     * @param userId
     * @return
     */
    List<Favorite> getMyFavorites(int userId) throws SQLException;

    /**
     * 获取用户在收藏中存在的分类
     * @param userId
     * @return
     */
    List<FavoriteCategory> getMyFavoriteCategorysInFavorite(int userId) throws SQLException;

    /**
     * 删除一个收藏
     *
     * @param favoriteId
     * @param userId
     * @return
     */
    int delFavorite(int favoriteId, int userId) throws SQLException;

    /**
     * 获取我的一个收藏
     *
     * @param favoriteId
     * @param userId
     * @return
     */
    Favorite getFavorite(int favoriteId, int userId) throws SQLException;
}
